home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Communication / NGService / Source / MMFolderCell.m < prev    next >
Text File  |  1993-09-02  |  933b  |  47 lines

  1. /*
  2.  *      You may freely copy, distribute and reuse the code
  3.  *      in this example.  Scott Anguish disclaims any warranty of
  4.  *      any kind, expressed or implied, as to its fitness
  5.  *      for any particular use.
  6.  *        Please keep this notice intact
  7.  *      Written by: Scott Anguish  sanguish@digifix.com
  8.  */
  9.  
  10. #import "MMFolderCell.h"
  11.  
  12. #import <libc.h>                      /* MAXPATHLEN */
  13. #import <stdio.h>
  14. #import <strings.h>
  15.  
  16. #import <appkit/appkit.h>
  17.  
  18. #import <streams/streams.h>
  19.  
  20.  
  21. @implementation MMFolderCell:MMCell
  22.  
  23. - imageFromFilename:(const char *)filename
  24. {
  25.     if (!theImage)
  26.             {
  27.             theImage=[[Application workspace] getIconForFile:filename];
  28.             if (!theImage){ 
  29.                     theImage = [[NXImage alloc] initFromFile: "/usr/lib/nib/folder_nib.tiff" ];
  30.                     }
  31.             }    return self;
  32.  
  33. }    
  34.  
  35. - imageFromAttachment
  36. {
  37.  
  38.     char filename[MAXPATHLEN+1];
  39.  
  40.     sprintf(filename,"/tmp/%s",attachmentName);
  41.     [self imageFromFilename:filename];
  42.     return self;
  43. }
  44.  
  45.  
  46. @end
  47.